package interfacetest;

public class Duotai {
    public static void main(String[] args) {
        Animal c = new cat();
        c.eat();
        System.out.println(((cat) c).num);
        c.walk();
    }
}


class Animal {
    int num = 20;

    public void eat() {
        System.out.println("动物吃肉");
    }

    public void walk() {
        System.out.println("带我走录");
    }
}

class cat extends Animal {
    int num = 100;
    public void eat() {
        System.out.println("猫吃肉");
    }
}
